Skip to content

Dev media tests#439

Open
artemdemo wants to merge 5 commits intomainfrom
dev-media-tests
Open

Dev media tests#439
artemdemo wants to merge 5 commits intomainfrom
dev-media-tests

Conversation

@artemdemo
Copy link
Contributor

@artemdemo artemdemo commented Mar 23, 2026

Note

Description

This PR adds integration tests for media file handling in the dev command, covering both public and private file upload/serve flows. It also refactors the waitForDevServer helper into a shared dev-utils.ts testkit utility so it can be reused across test files.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe): Test coverage addition with minor testkit refactoring

Changes Made

  • Added packages/cli/tests/cli/dev-media.spec.ts with two new integration tests:
    • Public file upload: uploads a file via Core/UploadFile, verifies the returned URL, and fetches the file content
    • Private file upload: uploads a file via Core/UploadPrivateFile, obtains a signed URL via Core/CreateFileSignedUrl, and validates access with valid token, wrong token (400 + InvalidJWT), and missing token (401 + Missing token)
  • Extracted waitForDevServer from dev.spec.ts into packages/cli/tests/cli/testkit/dev-utils.ts to share it across test files
  • Updated dev.spec.ts to import waitForDevServer from the new shared location

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated docs/ (AGENTS.md) if I made architectural changes

Additional Notes

The waitForDevServer refactor also improves robustness by throwing an explicit error if the URL pattern is not found (instead of a non-null assertion).


🤖 Generated by Claude | 2026-03-23 13:22 UTC

@artemdemo artemdemo marked this pull request as ready for review March 23, 2026 12:46
@github-actions
Copy link
Contributor

github-actions bot commented Mar 23, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.47-pr.439.4472b1f

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.47-pr.439.4472b1f"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.47-pr.439.4472b1f"
  }
}

Preview published to npm registry — try new features instantly!

@base44 base44 deleted a comment from claude bot Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant